package com.heima.consumer.listener;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;



@Component
public class KafkaConsumerListener {

    @KafkaListener(topics = "kafka.test.topic1",groupId = "group1")
    public void receiveMessage(ConsumerRecord<String,String> record){
        String key = record.key();
        String value = record.value();

        System.out.println( key +":"+ value);

    }
}
